import Api from "@/api/operations/events";
import i18n from "@/lang/index";
const contentConfig = {
  pageName: "sys:user",
  table: {
    border: true,
    highlightCurrentRow: false,
  },
  indexAction: (data) => {
    console.log("index", data);
    return new Promise((resolve, reject) => {
      Api.getList(data).then(s => {
        console.log('data-----------------', data);
        resolve(s)
      }).catch(e => {
        reject(e)
      })
    });
  },
  deleteAction: function (id) {
    console.log("delete", id);
    return new Promise((resolve, reject) => {
      Api.del({ id }).then(s => {
        resolve({
          code: "00000",
          data: null,
          msg: i18n.global.t('hint.7'),
        })
      }).catch(e => {
        reject(e)
      })
    });
  },
  exportAction: function (queryParams) {
    // 导出Excel文件
    // return exportUser(queryParams);
  },
  pk: "id",
  toolbar: [
    "refresh",
    "add",
    // "delete",
    // "export",
    // {
    //   name: "import",
    //   icon: "upload",
    //   text: "导入",
    //   auth: "import",
    // },
  ],
  cols: [
    // { type: "selection", width: 50, align: "center" },
    { label: "ID", align: "center", prop: "id",minWidth:50,fixed:'left' },
    { label: i18n.global.t('label.61'), align: "center", prop: "title",minWidth:250,fixed:'left' },
    { label: i18n.global.t("label.62"), align: "center", type: "img", prop: "image_url" },
    { label: i18n.global.t("label.63"), align: "center",templet: 'custom', prop: "type", minWidth: 150 },
    { label: i18n.global.t("label.105"), align: "center",  templet: 'custom',prop: "visible", minWidth: 150 },
    { label: i18n.global.t("label.23"), align: "center",templet: 'custom',  prop: "status", minWidth: 150 },
    { label: i18n.global.t("label.59"), align: "center", templet: 'custom', prop: "started_at", minWidth: 150 },
    { label: i18n.global.t("form.55"), align: "center", templet: 'custom', prop: "ended_at", minWidth: 150 },
    { label: i18n.global.t("label.36"), align: "center", prop: "sort",minWidth: 80 },
    { label: i18n.global.t('label.38'), align: "center", type: "time", prop: "created_at", minWidth: 180 },
    {
      label: i18n.global.t('label.8'),
      fixed: "right",
      templet: "tool",
      align: "center",
      width: 200,
      operat: [
        // {
        //   name: "details",
        //   text: "查看详情",
        // },
        "edit",
        "delete",
      ],
    },
  ],
};

export default contentConfig;